<%-- 
    Document   : AddUser
    Created on : Dec 25, 2011, 11:58:42 PM
    Author     : Ketsaraporn
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<!DOCTYPE html>
<html:html lang="true">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="css/view.css" type="text/css"/>   
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/function.js"></script>
        <title><bean:message key="welcome.title"/></title>
        <html:base/>
        <script>
            function goSelected() {
                redirect("${pageContext.request.contextPath}/addUser.do?dispatch=doListAddUser","_top");
            }
            
        </script>
    </head>
    <body>

        <html:form action="/addUser.do?dispatch=doAddUser" >            
            <div class="content1">                   
                <table class="three" cellspacing="0">
                    <tr>
                        <td colspan="2"><div align="center"><strong>ผู้ใช้งานระบบ</strong></div></td>
                    </tr>
                    <tr>
                        <th colspan="2">เพิ่มผู้ใช้งานระบบ</th>
                    </tr>
                    <tr>
                        <td width="88">รหัสผู้ใช้ :</td>
                        <td width="686"><html:text property="userEntity.useId" size="30"/>
                            <html:errors property="userid"/><span style="color: red">*</span></td>
                    </tr>
                    <tr>
                        <td>ชื่อผู้ใช้ : 
                        </td>
                        <td><html:text property="userEntity.useName" size="30"/><span style="color: red">*</span></td>
                    </tr>

                    <tr>
                        <td>รหัสผ่าน :</td>
                        <td><html:password property="userEntity.usePassword" /><span style="color: red">*</span></td>
                    </tr>
                    <tr>
                        <td>คำนำหน้า :</td>
                        <td><html:text property="userEntity.useTitle" size="30"/><span style="color: red">*</span></td>
                    </tr>
                    <tr>
                        <td>ชื่อ :</td>
                        <td><html:text property="userEntity.useFirstName" size="30"/><span style="color: red">*</span></td>
                    </tr>
                    <tr>
                        <td>นามสกุล :</td>
                        <td><html:text property="userEntity.useLastName" size="30"/><span style="color: red">*</span></td>
                    </tr>
                    <tr>
                        <td>ตำแหน่ง :</td>
                        <td><html:text property="userEntity.usePosition" size="30"/><span style="color: red">*</span></td>
                    </tr>
                    <tr>
                        <td>คณะ :</td>
                        <td>
                            <html:select property="userEntity.facId" onchange="goSelected();">
                                <html:option value="">กรุณาเลือก</html:option>
                                <html:optionsCollection property="facultyList" label="facName" value="facId"/>
                            </html:select>
                            <span style="color: red">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td>ภาควิชา :</td>
                        <td>
                            <html:select property="userEntity.depId">
                                 <html:option value="">กรุณาเลือก</html:option>
                                <html:optionsCollection property="departmentList" label="depName" value="depId"></html:optionsCollection>
                            </html:select>  
                            <span style="color: red">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td>ประเภท :</td>
                        <td>
                            <html:select property="userEntity.userTypeId"> 
                                <html:optionsCollection property="userTypeList" label="userTypeDesc" value="userTypeId"></html:optionsCollection>
                            </html:select>
                            <span style="color: red">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <div align="center">
                                <html:submit property="btnSave" value="บันทึก"/>  
                                <html:cancel property="btnReset" value="ยกเลิก"/>                                                               
                            </div></td>        
                    </tr>
                </table>
            </div>
        </html:form>      
    </body>
</html:html>